from time import sleep

import webdriver_manager.core.utils

from common.Utils import SearchDriver
from test.CompatibleTest import Compatible
from test.SearchFunTest import SearchFunc
from test.SearchSafe import SearchSafeTest
from test.SearchUITest import SearchUI

if __name__ == "__main__":
    SearchUI().Searchui()
    SearchUI().Searchblock()
    SearchFunc().SearchSuccess()
    SearchFunc().SearchFailed()
    Compatible().test_resolution(1920, 1080)
    sleep(2)
    Compatible().test_resolution(1366, 768)
    sleep(2)
    Compatible().test_resolution(800, 600)
    sleep(2)
    Compatible().test_resolution(1920, 1080)
    test = SearchSafeTest()
    test.Safetes("<script>alert('xss')</script>")
    test.Safetes("<h1>Test</h1>")
    test.Safetes("<img src=x onerror=alert(1)>")
    test.Safetes(";--><script>")
    test.Safetes("\u202E")
    test.Safetes("/search?q=xxx")
    test.Safetes("../../etc/passwd")
    SearchDriver.driver.quit()